package json;

import java.util.Date;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

import pojo.Person;
import pojo.Person.Sex;

public class PojoTest {

	public static void main(String[] args) {
		
		Person person = new Person();
		person.setName("涂有");
		person.setAge(24);
		person.setBirth(new Date());
		person.setSex(Sex.man);
		
		System.out.println(JSON.toJSONString(person, new SerializerFeature[]{SerializerFeature.WriteEnumUsingName, SerializerFeature.WriteDateUseDateFormat}));
		
		
		System.out.println(JSON.toJSON(person));
	}
}
